breadth first search algorithm example